package com.yc.biz.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yc.bean.Person;
import com.yc.biz.PersonBiz;
import com.yc.dao.BaseDaoHib;
import com.yc.dao.PersonDao;
@Transactional
@Service("personBiz")
public class PersonBizImpl implements PersonBiz {

	
	@Resource(name="personDao")
	private PersonDao personDao;
	
	@Override
	public void addPerson(Person person) {
		((BaseDaoHib)personDao).save(person);
	
	}

	public void setPersonDao(PersonDao personDao) {
		this.personDao = personDao;
	}

	@Override
	public List<Person> findPerson(Person person) {
		List<Person> list=((BaseDaoHib) personDao).findByExample(person);
		return list;
	}

//	@Override
//	public List<Person> findPerson(Person person) {
////		List<Person> list=((BaseDaoHib) personDao).findByExample(person));
//		return null;
//	}
	
	
	

}
